package kugou

import (
	"api-go/serializer"
	kugou "api-go/service/v1/kugou"
	"fmt"

	"github.com/gin-gonic/gin"
)

//搜索
func Search(c *gin.Context) {
	var service kugou.Search
	var res *serializer.Response
	if err := c.ShouldBindQuery(&service); err != nil {
		fmt.Println(err)
		res = serializer.ErrorResponse(serializer.CodeParamError)
	} else {
		res = service.SearchInfo()
	}
	c.JSON(200, res)
}

//热搜
func SearchHot(c *gin.Context) {
	var service kugou.Search
	var res *serializer.Response
	if err := c.ShouldBindQuery(&service); err != nil {
		fmt.Println(err)
		res = serializer.ErrorResponse(serializer.CodeParamError)
	} else {
		res = service.SearchHot()
	}
	c.JSON(200, res)
}
